* Stata code for Figure 1 in 
* L.J Zigerell
* Left Unchecked: Political Hegemony in Political Science and the Flaws It Can Cause
* PS: Political Science & Politics

*** ANES 2016 Time Series Study
*** anes_timeseries_2016_Stata12.dta [downloaded Jan 19, 2019]

// 2016 U.S. presidential election vote choice

tab V162062x
gen trump = V162062x
recode trump (-9/-1=.) (1 3/5=0) (2=1)
tab V162062x trump, mi

gen hrc = V162062x
recode hrc (-9/-1=.) (2/5=0) (1=1)
tab V162062x hrc, mi

// Discrimination against women

tab V160502 V162362
tab V162362
gen noDISCwomen = V162362
recode noDISCwomen (-9 1 2 3 4=0) (5=1) (-7/-1=.)
tab V162362 noDISCwomen, mi

// Discrimination against men

tab V160502 V162363
tab V162363
gen noDISCmen = V162363
recode noDISCmen (-9 1 2 3 4=0) (5=1) (-7/-1=.)
tab V162363 noDISCmen, mi

svyset [pweight=V160102], strata(V160201) psu(V160202) 
svy: prop noDISCwomen if trump==1

svyset [pweight=V160102], strata(V160201) psu(V160202) singleunit(centered)
svy: prop noDISCwomen if hrc==1
svy: prop noDISCwomen if trump==1
svy: prop noDISCmen   if hrc==1
svy: prop noDISCmen   if trump==1

* Unweighted
tab V162362 if V162062x==1 & V162363!=-7 & V162363!=-6 & V162363!=-5 // HRC
tab V162362 if V162062x==2 & V162363!=-7 & V162363!=-6 & V162363!=-5 // Trump
tab V162363 if V162062x==1 & V162363!=-7 & V162363!=-6 & V162363!=-5 // HRC
tab V162363 if V162062x==2 & V162363!=-7 & V162363!=-6 & V162363!=-5 // Trump

* Weighted
svy: tab V162362 if V162062x==2 & V162363!=-7 & V162363!=-6 & V162363!=-5 // Trump
svy: tab V162362 if V162062x==1 & V162363!=-7 & V162363!=-6 & V162363!=-5 // HRC
svy: tab V162363 if V162062x==2 & V162363!=-7 & V162363!=-6 & V162363!=-5 // Trump
svy: tab V162363 if V162062x==1 & V162363!=-7 & V162363!=-6 & V162363!=-5 // HRC
